<?php if (!defined('MAX_ON')){echo "<h1>ACCESS DENIED</h1>You cannot access this file directly.";exit();} ?>
<?php if ($template_hook=='start'){ ?>
<?php }elseif ($template_hook=='1'){ ?>
	<script type="text/javascript" language="javascript" src="<?php echo $max_domain; ?>/includes/pages/gallery/rater/js/behavior.js"></script>
<?php include ($max_root.'/includes/pages/gallery/rater/js/rating.php'); ?>
	<link rel="stylesheet" type="text/css" href="<?php echo $max_domain; ?>/includes/pages/gallery/rater/css/rating_<?php echo $lang['header_dir']; ?>.css" />
	<?php include ($max_root.'/libs/js/comment.php'); ?>
<?php }elseif ($template_hook=='2'){ ?>
	<div class="f_right" style="width: 58%">

		<table class="forum-board-forum-head" cellpadding="0" cellspacing="0">
			<tr><td class="forum-topic-subject"><?php echo $row['title']; ?></td></tr>
		</table>
		
		<table class="forum-index" cellpadding="0" cellspacing="0">
		
			<tr>
				<td class="forum-index-stats-header forum-index-top"></td>
			</tr>
			
			<tr>
				<td class="forum-jump-content forum-index-top forum-index-bottom">
				
					<a href="<?php echo $max_domain . '/' . $row['image']; ?>" target="_blank">
					
						<img src="<?php echo $max_domain . '/' . $row['image']; ?>" style="width: <?php echo $width; ?>px; height: <?php echo $height; ?>px; border: 0px" />
						
					</a>
				
				</td>
			</tr>
		
		</table>
		
		<table class="forum-index-forum-footer" cellpadding="0" cellspacing="0">
			<tr><td class="forum-index-forum-footer-contents"> </td></tr>
		</table>
		
		<br />
		
		<table class="forum-board-forum-head" cellpadding="0" cellspacing="0">
			<tr><td class="forum-topic-subject"><?php echo $lang['view_image_add_comment']; ?></td></tr>
		</table>
		
		<table class="forum-index" cellpadding="0" cellspacing="0">
		
			<tr>
				<td class="forum-index-stats-header forum-index-top"><?php echo $lang['view_image_add_comment_desc']; ?></td>
			</tr>
			
			<tr>
				<td class="forum-jump-content forum-index-top forum-index-bottom">
				
					<form method="post" action="<?php echo max_link('index.php?page=gallery&act=view-image&id=' . $id, 'gallery/view-image/' . $id); ?>">
					
						<input type="hidden" name="image" value="<?php echo $id; ?>" />
					
						<textarea id="comment" name="comment" cols="75" rows="5"></textarea><br /><br />
					
						<div style="text-align: center">
						
							<input type="button" name="comment_submit" class="img-submit" value="<?php echo $lang['view_image_add_comment']; ?>" onclick="javascript:get(this.parentNode);" />
							
						</div>
						
					</form>
					
				</td>
			</tr>
			
		</table>
		
		<table class="forum-index-forum-footer" cellpadding="0" cellspacing="0">
			<tr><td class="forum-index-forum-footer-contents"> </td></tr>
		</table>
	
	</div>
	
	<div class="f_right" style="width: 4%">&nbsp;</div>
	
	<div class="f_right" style="width: 38%">
	
		<table class="forum-board-forum-head" cellpadding="0" cellspacing="0">
			<tr>
				<td class="forum-topic-subject">
			
					<?php if ($can_change_forum_settings == 1 || $can_change_site_settings == 1){ ?>
					
						<a href="<?php echo max_link('index.php?page=admin&act=gallery&sub=edit_image&id=' . $row['id'], 'admin/gallery/edit_image/' . $row['id']); ?>">
						
							<img src="<?php echo $edit_icon_img; ?>" alt="<?php echo $lang['my_images_edit']; ?>" title="<?php echo $lang['my_images_edit']; ?>" />
					
						</a>
					
						<a href="<?php echo max_link('index.php?page=admin&act=gallery&sub=delete_image&id=' . $row['id'], 'admin/gallery/delete_image/' . $row['id']); ?>" onclick="javascript:return confirm('<?php echo $lang['my_images_remove_warning']; ?>')">
						
							<img src="<?php echo $delete_icon_img; ?>" alt="<?php echo $lang['my_images_remove']; ?>" title="<?php echo $lang['my_images_remove']; ?>" />
					
						</a>
						
					<?php } ?>
					
				</td>
			</tr>
		</table>
		
		<table class="forum-index" cellpadding="0" cellspacing="0">
		
			<tr>
				<td class="forum-index-stats-header forum-index-top"><?php echo $lang['view_image_details']; ?></td>
			</tr>
			
			<tr>
				<td class="forum-jump-content forum-index-top forum-index-bottom"><?php echo $lang['view_image_uploaded_on']; ?></td>
			</tr>
			
			<tr>
				<td class="forum-index-stats-header forum-index-top"><?php echo $lang['view_image_description']; ?></td>
			</tr>
			
			<tr>
				<td class="forum-jump-content forum-index-top forum-index-bottom"><?php echo nl2br($row['description']); ?></td>
			</tr>
			
			<tr>
				<td class="forum-index-stats-header forum-index-top"><?php echo $lang['view_image_rating']; ?></td>
			</tr>
			
			<tr>
				<td class="forum-jump-content forum-index-top forum-index-bottom">
				
					<?php echo rating_bar($row['id'], 5); ?>
				
				</td>
			</tr>
			
			<tr>
				<td class="forum-index-stats-header forum-index-top"><?php echo $lang['view_image_comments']; ?></td>
			</tr>
			
			<tr>
				<td class="forum-jump-content forum-index-top forum-index-bottom" name="comments" id="comments">
<?php }elseif ($template_hook=='3'){ ?>
					<div style="background-color: #FFFDCC; border: 1px dashed #CCCCCC; padding: 5px; margin-bottom: 5px;">
					
						<?php echo nl2br($row['comment']); ?><br /><br />
						
						<?php echo $by; ?>
					
					</div>
<?php }elseif ($template_hook=='4'){ ?>
				</td>
			</tr>
			
		</table>
		
		<table class="forum-index-forum-footer" cellpadding="0" cellspacing="0">
			<tr><td class="forum-index-forum-footer-contents"> </td></tr>
		</table>
	
	</div>
<?php }elseif ($template_hook=='5'){ ?>
					<div style="background-color: #F2E3E3; border: 1px dashed #CCCCCC; color: #7C1C1C; padding: 5px; margin-bottom: 5px;">
					
						<?php echo $lang['view_image_comments_already']; ?>
	
					</div>
<?php }elseif ($template_hook=='end'){ ?>		
<?php } ?>